package servicediscovery;

import io.vertx.ext.web.Router;
import io.vertx.ext.web.RoutingContext;
import io.vertx.ext.web.handler.BodyHandler;

/**
 * @Author Ldj
 * @Date 2017/11/3 16:09
 * @Description 数据处理
 */
public class APIGateWayVerticle extends RestAPIVerticle {

    @Override
    public void start() throws Exception {
        super.start();
        /*// get HTTP host and port from configuration, or use default value
        String host = config().getString("api.gateway.http.address", "localhost");
        int port = config().getInteger("api.gateway.http.port", DEFAULT_PORT);

        Router router = Router.router(vertx);
        // cookie and session handler
        //enableLocalSession(router);

        // body handler
        router.route().handler(BodyHandler.create());

        //测试API转发
        // set auth callback handler
        router.route("/callback").handler(context -> authCallback(oauth2, hostURI, context));

        //router.get("/uaa").handler(this::authUaaHandler);
        router.get("/login").handler(this::loginEntryHandler);*/
    }

    private void loginEntryHandler(RoutingContext context) {
        //context.response().putHeader("")
        /*context.response()
                .putHeader("Location", generateAuthRedirectURI(buildHostURI()))
                .setStatusCode(302)
                .end();*/
    }
}
